<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        function getSum(i,j) {


            if(typeof i !='number'|| (typeof j!='number')){
                alert('请输入数字')
                return;
            }
            var temp;
            if (i>j){
                temp=i;
                i=j;
                j=temp;
            }
            var sum = 0;
            for (var k = i; k <=j ; k++) {
                sum += k;
            }
          return 1,sum;        //函数返回值   只能返回最后一个值    多个值可以返回数组
        }


        var sum = getSum(1,100);
        console.log(sum)

        console.log('luu'-1);    //NaN
    </script>
</head>
<body>

</body>
</html>